<?php
class cls_serve_supplier extends cls_serve_base
{
	function get_supplier_list()
	{
		$supplier_data = parent::get_data();
		$supplier_list = $supplier_data->get_supplier_list();
		return $supplier_list;
	}
	
	function create($parameter)
	{
		$supplier_data = parent::get_data();
		$a = $supplier_data->get_supplier_info($parameter['sp_name']);
		if(!empty($a)){
			return return_info(false,"供货商已存在！");
		}
	
		$value = array('sp_name' => $parameter['sp_name']);
		$value['sp_linkman'] = $parameter['sp_linkman'];
		$value['sp_tel'] = $parameter['sp_tel'];
		$value['sp_addr'] = $parameter['sp_addr'];
		$value['sp_note'] = $parameter['sp_note'];
		$result = $supplier_data->create($value);
	
		return $result;
	}
}